package com.example.service.impl;

import com.example.mapper.UserMapper;
import com.example.pojo.User;
import com.example.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    public User queryById(Long id) {
        if (1 == id)
            throw new RuntimeException("模拟报错");
        return this.userMapper.selectByPrimaryKey(id);
    }
}
